package com.hxc.common.common;

import lombok.NoArgsConstructor;

@NoArgsConstructor
public class ResponseData {

    private Integer status;//1:成功，0:失败
    private String msg;//消息
    private Object data;//数据内容

    public ResponseData(Integer status, String msg, Object data) {
        this.status = status;
        this.msg = msg;
        this.data = data;
    }

    public ResponseData(Integer status, Object data) {
        this.status = status;
        this.data = data;
    }

    public ResponseData(Integer status, String msg) {
        this.status = status;
        this.msg = msg;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public static ResponseData success(Object data) {
        return new ResponseData(1, data);
    }

    public static ResponseData success(String msg) {
        return new ResponseData(1, msg);
    }

    public static ResponseData success(String msg, Object data) {
        return new ResponseData(1, msg, data);
    }

    public static ResponseData error(String msg) {
        return new ResponseData(0, msg);
    }
}
